home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  5.4 KB  |  219 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Processes.p
  3.  
  4.      Contains:    Process Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Processes;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __PROCESSES__}
  30. {$SETC __PROCESSES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ProcessesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __EVENTS__}
  43. {$I Events.p}
  44. {$ENDC}
  45. {    Quickdraw.p                                                    }
  46. {        MixedMode.p                                                }
  47. {        QuickdrawText.p                                            }
  48. {    OSUtils.p                                                    }
  49. {        Memory.p                                                }
  50.  
  51. {$IFC UNDEFINED __FILES__}
  52. {$I Files.p}
  53. {$ENDC}
  54. {    Finder.p                                                    }
  55.  
  56. {$PUSH}
  57. {$ALIGN MAC68K}
  58. {$LibExport+}
  59.  
  60. TYPE
  61.     ProcessSerialNumber = RECORD
  62.         highLongOfPSN:            LONGINT;
  63.         lowLongOfPSN:            LONGINT;
  64.     END;
  65.  
  66.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  67.  
  68.  
  69. CONST
  70. { Process identifier - Various reserved process serial numbers }
  71.     kNoProcess                    = 0;
  72.     kSystemProcess                = 1;
  73.     kCurrentProcess                = 2;
  74.  
  75. { Definition of the parameter block passed to _Launch
  76.     Typedef and flags for launchControlFlags field }
  77.     
  78. TYPE
  79.     LaunchFlags = INTEGER;
  80.  
  81.  
  82. CONST
  83. { Definition of the parameter block passed to _Launch }
  84.     launchContinue                = $4000;
  85.     launchNoFileFlags            = $0800;
  86.     launchUseMinimum            = $0400;
  87.     launchDontSwitch            = $0200;
  88.     launchAllow24Bit            = $0100;
  89.     launchInhibitDaemon            = $0080;
  90.  
  91. { Format for first AppleEvent to pass to new process.  The size of the overall
  92.   buffer variable: the message body immediately follows the messageLength }
  93.  
  94. TYPE
  95.     AppParameters = RECORD
  96.         theMsgEvent:            EventRecord;
  97.         eventRefCon:            LONGINT;
  98.         messageLength:            LONGINT;
  99.     END;
  100.  
  101.     AppParametersPtr = ^AppParameters;
  102.  
  103. { Parameter block to _Launch }
  104.     LaunchParamBlockRec = RECORD
  105.         reserved1:                LONGINT;
  106.         reserved2:                INTEGER;
  107.         launchBlockID:            INTEGER;
  108.         launchEPBLength:        LONGINT;
  109.         launchFileFlags:        INTEGER;
  110.         launchControlFlags:        LaunchFlags;
  111.         launchAppSpec:            FSSpecPtr;
  112.         launchProcessSN:        ProcessSerialNumber;
  113.         launchPreferredSize:    LONGINT;
  114.         launchMinimumSize:        LONGINT;
  115.         launchAvailableSize:    LONGINT;
  116.         launchAppParameters:    AppParametersPtr;
  117.     END;
  118.  
  119.     LaunchPBPtr = ^LaunchParamBlockRec;
  120.  
  121. { Set launchBlockID to extendedBlock to specify that extensions exist.
  122.  Set launchEPBLength to extendedBlockLen for compatibility.}
  123.  
  124. CONST
  125.     extendedBlock                = $4C43;                        { 'LC' }
  126.     extendedBlockLen            = 32;                            { sizeof(LaunchParamBlockRec) - 12 }
  127.  
  128. { Definition of the information block returned by GetProcessInformation }
  129.     modeDeskAccessory            = $00020000;
  130.     modeMultiLaunch                = $00010000;
  131.     modeNeedSuspendResume        = $00004000;
  132.     modeCanBackground            = $00001000;
  133.     modeDoesActivateOnFGSwitch    = $00000800;
  134.     modeOnlyBackground            = $00000400;
  135.     modeGetFrontClicks            = $00000200;
  136.     modeGetAppDiedMsg            = $00000100;
  137.     mode32BitCompatible            = $00000080;
  138.     modeHighLevelEventAware        = $00000040;
  139.     modeLocalAndRemoteHLEvents    = $00000020;
  140.     modeStationeryAware            = $00000010;
  141.     modeUseTextEditServices        = $00000008;
  142.     modeDisplayManagerAware        = $00000004;
  143.  
  144. { Record returned by GetProcessInformation }
  145.  
  146. TYPE
  147.     ProcessInfoRec = RECORD
  148.         processInfoLength:        LONGINT;
  149.         processName:            StringPtr;
  150.         processNumber:            ProcessSerialNumber;
  151.         processType:            LONGINT;
  152.         processSignature:        OSType;
  153.         processMode:            LONGINT;
  154.         processLocation:        Ptr;
  155.         processSize:            LONGINT;
  156.         processFreeMem:            LONGINT;
  157.         processLauncher:        ProcessSerialNumber;
  158.         processLaunchDate:        LONGINT;
  159.         processActiveTime:        LONGINT;
  160.         processAppSpec:            FSSpecPtr;
  161.     END;
  162.  
  163.     ProcessInfoRecPtr = ^ProcessInfoRec;
  164.  
  165.  
  166. FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
  167.     {$IFC NOT GENERATINGCFM}
  168.     INLINE $205F, $A9F2, $3E80;
  169.     {$ENDC}
  170. FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: ConstStr255Param): OSErr;
  171.     {$IFC NOT GENERATINGCFM}
  172.     INLINE $3F3C, $0036, $A88F;
  173.     {$ENDC}
  174. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  175.     {$IFC NOT GENERATINGCFM}
  176.     INLINE $3F3C, $0037, $A88F;
  177.     {$ENDC}
  178. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  179.     {$IFC NOT GENERATINGCFM}
  180.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  181.     {$ENDC}
  182. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  183.     {$IFC NOT GENERATINGCFM}
  184.     INLINE $3F3C, $0038, $A88F;
  185.     {$ENDC}
  186. FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  187.     {$IFC NOT GENERATINGCFM}
  188.     INLINE $3F3C, $003A, $A88F;
  189.     {$ENDC}
  190. FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  191.     {$IFC NOT GENERATINGCFM}
  192.     INLINE $3F3C, $003B, $A88F;
  193.     {$ENDC}
  194. FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  195.     {$IFC NOT GENERATINGCFM}
  196.     INLINE $3F3C, $003C, $A88F;
  197.     {$ENDC}
  198. FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  199.     {$IFC NOT GENERATINGCFM}
  200.     INLINE $3F3C, $003D, $A88F;
  201.     {$ENDC}
  202. {$IFC NOT OLDROUTINELOCATIONS }
  203. PROCEDURE ExitToShell;
  204.     {$IFC NOT GENERATINGCFM}
  205.     INLINE $A9F4;
  206.     {$ENDC}
  207. {$ENDC}
  208.  
  209. {$ALIGN RESET}
  210. {$POP}
  211.  
  212. {$SETC UsingIncludes := ProcessesIncludes}
  213.  
  214. {$ENDC} {__PROCESSES__}
  215.  
  216. {$IFC NOT UsingIncludes}
  217.  END.
  218. {$ENDC}
  219.